<?php
require_once("includes/global.inc");

$smarty = get_smarty();

if(isset($_POST['login']) && isset($_POST['password']))
{
    $login = new Login();
    $error_message = "";


    if ($login->Authorize($_POST['login'],$_POST['password'],$error_message))
    {
       if(isset($_COOKIE['page']))
         header("Location:".$_COOKIE["page"]);
       exit();
    }
    else
    {
        $smarty->assign("error_message",$error_message);
    }

}
show_full_page("join_full_template.tpl",$smarty);
